import time

from app.modules.apps.container_tomcat import TomcatMultiWarApp, TomcatDepApp
from app.modules.common import network

tomcat = TomcatDepApp(app_id='gzidc:dep',
                      app_name='dep',
                      zone_home_path='/usr/local/app/uc.gzidc.area',
                      nas_app_package_path='/mnt/winitRelease/latest.product/dep',
                      zone_alias='gzidc',
                      port=1380,
                      db_name='ADEMPIERE')

tomcat.stop()
tomcat.uninstall_app()
tomcat.install_app()
tomcat.restart()
print tomcat.is_started()

time.sleep(3)
print tomcat.is_started()
time.sleep(3)
# tomcat.stop()
print tomcat.is_started()
